#!/usr/bin/env bash
# 判断 Dockerfile是否存在
if [[ ! -e Dockerfile ]];then
  echo "Dockerfile not found"
  exit 1
fi
docker build -t ccr.ccs.tencentyun.com/liumou/thrive-server:latest .
if [[ $? -ne 0 ]];then
  echo "build failed"
  exit 1
fi

docker push ccr.ccs.tencentyun.com/liumou/thrive-server:latest
if [[ $? -ne 0 ]];then
  echo "push failed"
  exit 1
fi
echo "build and push success"